<?php
session_start();
//开启最高级别报错(开发阶段尽量捕捉错误)
error_reporting(E_ALL);
//指定编码
header('Content-type:text/html;charset=utf-8');
//设置时区
date_default_timezone_set('Asia/Shanghai');
//创建一个实际路径
define('ROOT_PATH',substr(dirname(__FILE__),0,-8));
//引入Smarty
require ROOT_PATH.'/smarty/Smarty.class.php';
//引入配置文件
require ROOT_PATH.'/configs/profile.inc.php';

//自动加载类
function __autoload($className) {
    if(substr($className,-6) == 'Action') {
        require ROOT_PATH.'/controller/'.$className.'.class.php';
    } else if(substr($className,-5) == 'Model') {
        require ROOT_PATH.'/model/'.$className.'.class.php';
    } else if(substr($className,-5) == 'Check') {
        require ROOT_PATH.'/check/'.$className.'.class.php';
    } else {
        require ROOT_PATH.'/public/'.$className.'.class.php';
    }
}
//动态实例化模块
Factory::initAction()->run();
?>